

/*


############################################################
#    Supportive Management Practice and Intrinsic          #
#            Motivation Go Together                        #
#              Dan Honig, PNAS 2021		                   #			 
#               Replication Archive                        #
#           February 6, 2021                               #
############################################################

GENERAL INFORMANTION

This file generates all tables which underlie Honig "Supportive Management Practice and Intrinsic Motivation Go Together",
currently under review at PNAS.

Figures are generated in R. The code which turns this output
into figures can be found in the "R code for figures" subfolder.


THIS FILE INFORMATION

This file generates the tables for models with employee attitudes, which include  
intrinsic motivation, job satisfaction, employee inclusion, organization pride, and WPI as the response variables,
and various management practices, agency, survey, and time FEs as independent variables.

It thinks about the data at 3 levels of analysis/modeling.  These are:
  
P1 data: pooled agency-level data (US, Canada, India, UK).  Include agency, survey, and time FEs.
P2 data: pooled agency-level data (US, Canada, India, UK).  Include survey FE.
P3 data: pooled individual-level data (US, Western Australia, Australia). Include survey and time FEs.



 
** #### Models with Agency Level Data ###
  */
  
**Import data**
clear

*global STATA_directory "INSERT ROOT DIRECTORY PATHWAY HERE" 
cd "$STATA_directory"


/**************** Import Data **********************/
import delimited "$STATA_directory/data_p1p2",clear  

set matsize 800



/**************** Process Data **********************/

** store all IVs and DVs in a local list **
local myvars coworkers_perf	creativity dept_org dev	///
employee_inclusion fair_rwd intrinsic_motivation job_satisfaction ///	
making_a_diff mgr_fb non_verifiable org_pride pay_satisfaction promote_ethics ///	
pysc_safety qual_supervisor qual_upr_mgmt rec_perception resources safety ///	
skills_match survey	well_being year


** replace all "NA" and 99 to ".", STATA does not recognize NA as missing value ** 
foreach v in `myvars' {
	capture confirm string variable `v'  // Do only for all string variable (columns with NA)
	if !_rc {
		replace `v' = "" if `v' == "NA"
	}
 }
 ** replace str non_verifiable with numeric values **
 gen non_ver = real(non_verifiable)
 tostring non_ver, gen(non_ver_temp)
 

 
 
** Encode "survey" as a numeric variable: **
encode survey, gen(survey1)
drop survey
rename survey1 survey
order survey

encode dept_org, gen(dept_org1)
drop dept_org
rename dept_org1 dept_org
order dept_org

encode govt, gen(govt1)
drop govt
rename govt1 govt
order govt

gen non_ver_cat = 0 if non_ver_temp == "0"
replace non_ver_cat = 1 if non_ver_temp =="1"
 


/** Label Variables **/

label var intrinsic_motivation "Intrinsic Motivation"
label var employee_inclusion "Employee Inclusion"
label var job_satisfaction "Job Satisfaction"
label var org_pride "Organizational Pride"
label var job_satisfaction "Job Satisfaction"
label var wpi_e "WPI- Enjoyment"


label var autonomy  "Autonomy"
label var resources  "Adequate resources"
label var dev  "Career & personal development"
label var clear_obj  "Clear objective"
label var creativity  "Creativity & innovation"
label var fair_rwd  "Fair reward & punishment"
label var mgr_fb  "Managerial feedback"

label var pay_satisfaction  "Pay satisfaction"
label var pysc_safety  "Psychological safety"
label var qual_supervisor  "Quality supervisor"
label var qual_upr_mgmt  "Quality upper management"
label var rec_perception  "Recognition perception"
label var skills_match  "Skills match"
label var well_being  "Well-being"
label var coworkers_perf "Co-workers' performance"

**Shift Directory so Tables Save in Subfolder
cd "$STATA_directory/table_output" 


/*** Summary Table (by country) ***/

/* 1: Canada, 2: FEVS, 3: India, 4: UK */

sum intrinsic_motivation autonomy resources dev clear_obj creativity ///
pay_satisfaction qual_supervisor qual_upr_mgmt rec_perception ///
skills_match well_being non_ver_cat  if survey==1 // Canada


sutex2 intrinsic_motivation autonomy resources dev clear_obj creativity ///
pay_satisfaction qual_supervisor qual_upr_mgmt rec_perception ///
skills_match well_being non_ver_cat if survey==1, min varlabels saving (Canada_summary_Table_A5.tex) replace  // Canada



sum intrinsic_motivation autonomy resources dev clear_obj creativity fair_rwd ///
mgr_fb pay_satisfaction pysc_safety qual_supervisor qual_upr_mgmt rec_perception ///
skills_match well_being coworkers_perf non_ver_cat if survey==2 // FEVS

sutex2 intrinsic_motivation autonomy resources dev clear_obj creativity fair_rwd ///
mgr_fb pay_satisfaction pysc_safety qual_supervisor qual_upr_mgmt rec_perception ///
skills_match well_being coworkers_perf non_ver_cat if survey==2, min varlabels saving (US_summary_Table_A1.tex) replace  // FEVS



sum intrinsic_motivation autonomy resources creativity fair_rwd ///
mgr_fb qual_supervisor rec_perception ///
skills_match coworkers_perf non_ver_cat if survey==3 // India

sutex2 intrinsic_motivation autonomy resources creativity fair_rwd ///
mgr_fb qual_supervisor rec_perception ///
skills_match coworkers_perf non_ver_cat if survey==3,  min varlabels saving (India_summary_Table_A7.tex) replace  // India


sum intrinsic_motivation autonomy resources dev clear_obj creativity fair_rwd ///
mgr_fb pay_satisfaction pysc_safety qual_supervisor qual_upr_mgmt rec_perception ///
skills_match well_being coworkers_perf non_ver_cat if survey==4 // UK

sutex2 intrinsic_motivation autonomy resources dev clear_obj creativity fair_rwd ///
mgr_fb pay_satisfaction pysc_safety qual_supervisor qual_upr_mgmt rec_perception ///
skills_match well_being coworkers_perf non_ver_cat if survey==4, min varlabels saving (UK_summary_Table_A6.tex) replace  // UK


****Full Summary Table (pooled data for US, Canada, UK, India) ***

sum intrinsic_motivation autonomy resources dev clear_obj creativity fair_rwd ///
mgr_fb pay_satisfaction pysc_safety qual_supervisor qual_upr_mgmt rec_perception ///
skills_match well_being coworkers_perf non_ver_cat 

sutex2 intrinsic_motivation autonomy resources dev clear_obj creativity fair_rwd ///
mgr_fb pay_satisfaction pysc_safety qual_supervisor qual_upr_mgmt rec_perception ///
skills_match well_being coworkers_perf non_ver_cat, min varlabels saving (full_agency_data_summary_MAINPAPER_Table_3.tex) replace  // full






/*****Regression Tables for P1 *****/ 

* DV: Intrinsic motivation *
* IV: management practice *
* survey, year and agency FEs *

* Part I table *
eststo clear
eststo: reg intrinsic_motivation autonomy i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation resources i.survey i.year i.dept_org, robust  
eststo: reg intrinsic_motivation dev i.survey i.year i.dept_org, robust
eststo: reg intrinsic_motivation clear_obj i.survey i.year i.dept_org, robust
eststo: reg intrinsic_motivation creativity i.survey i.year i.dept_org, robust
eststo: reg intrinsic_motivation fair_rwd i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation mgr_fb i.survey i.year i.dept_org, robust
esttab using table_A12.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year *.dept_org)


* Part II table *
eststo clear
eststo: reg intrinsic_motivation pay_satisfaction i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation pysc_safety i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation qual_supervisor i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation qual_upr_mgmt i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation rec_perception i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation skills_match i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation well_being i.survey i.year i.dept_org, robust 
esttab using table_A13.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year *.dept_org)


** Exclude FEVS data **
* DV: Intrinsic motivation *
* IV: management practice *
* survey, year and agency FEs *

preserve

drop if survey ==2


* Part I table *
eststo clear
eststo: reg intrinsic_motivation autonomy i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation resources i.survey i.year i.dept_org, robust  
eststo: reg intrinsic_motivation dev i.survey i.year i.dept_org, robust
eststo: reg intrinsic_motivation clear_obj i.survey i.year i.dept_org, robust
eststo: reg intrinsic_motivation creativity i.survey i.year i.dept_org, robust
eststo: reg intrinsic_motivation fair_rwd i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation mgr_fb i.survey i.year i.dept_org, robust
esttab using table_A16.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year *.dept_org)



* Part II table *
eststo clear
eststo: reg intrinsic_motivation pay_satisfaction i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation pysc_safety i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation qual_supervisor i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation qual_upr_mgmt i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation rec_perception i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation skills_match i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation well_being i.survey i.year i.dept_org, robust 
esttab using table_A17.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year *.dept_org)


/*****Regression Table for P2 *****/ 
* DV: Intrinsic motivation *
* IV: management practice *
* survey FE *

restore


* Part I table *
eststo clear
eststo: reg intrinsic_motivation autonomy i.survey, robust 
eststo: reg intrinsic_motivation resources i.survey, robust  
eststo: reg intrinsic_motivation dev i.survey, robust
eststo: reg intrinsic_motivation clear_obj i.survey, robust
eststo: reg intrinsic_motivation creativity i.survey, robust
eststo: reg intrinsic_motivation fair_rwd i.survey, robust 
eststo: reg intrinsic_motivation mgr_fb i.survey, robust
esttab using table_A14.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey)



* Part II table *
eststo clear
eststo: reg intrinsic_motivation pay_satisfaction i.survey, robust
eststo: reg intrinsic_motivation pysc_safety i.survey, robust
eststo: reg intrinsic_motivation qual_supervisor i.survey, robust
eststo: reg intrinsic_motivation qual_upr_mgmt i.survey, robust
eststo: reg intrinsic_motivation rec_perception i.survey, robust  
eststo: reg intrinsic_motivation skills_match i.survey, robust
eststo: reg intrinsic_motivation well_being i.survey, robust
esttab using table_A15.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey)


** Exclude FEVS data **
* DV: Intrinsic motivation *
* IV: management practice *
* survey FE *

preserve

drop if survey ==2


* Part I table *
eststo clear
eststo: reg intrinsic_motivation autonomy i.survey, robust 
eststo: reg intrinsic_motivation resources i.survey, robust  
eststo: reg intrinsic_motivation dev i.survey, robust
eststo: reg intrinsic_motivation clear_obj i.survey, robust
eststo: reg intrinsic_motivation creativity i.survey, robust
eststo: reg intrinsic_motivation fair_rwd i.survey, robust 
eststo: reg intrinsic_motivation mgr_fb i.survey, robust
esttab using table_A18.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey)



* Part II table *
eststo clear
eststo: reg intrinsic_motivation pay_satisfaction i.survey, robust
eststo: reg intrinsic_motivation pysc_safety i.survey, robust
eststo: reg intrinsic_motivation qual_supervisor i.survey, robust
eststo: reg intrinsic_motivation qual_upr_mgmt i.survey, robust
eststo: reg intrinsic_motivation rec_perception i.survey, robust  
eststo: reg intrinsic_motivation skills_match i.survey, robust
eststo: reg intrinsic_motivation well_being i.survey, robust
esttab using table_A19.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey)


restore



/*****Regression Table for intrinsic motivation with non-verifiable interaction terms H4 (P1) *****/ 
* DV: Intrinsic motivation *
* IV: management practice, non-verifiable, management practice X non-verifiable  *
* survey, year and agency FEs *


* Interaction terms *
gen resourcesXnonver = resources * non_ver_cat
gen autonomyXnonver = autonomy * non_ver_cat
gen creativityXnonver = creativity * non_ver_cat
gen qual_supervisorXnonver = qual_supervisor * non_ver_cat
gen rec_perceptionXnonver = rec_perception * non_ver_cat
gen skills_matchXnonver = skills_match * non_ver_cat

* Label variables *
label var resourcesXnonver  "Adequate resources X Non-verifiable tasks"
label var autonomyXnonver  "Autonomy X Non-verifiable tasks"
label var creativityXnonver  "Creativity & innovation X Non-verifiable tasks"
label var qual_supervisorXnonver  "Quality supervisor X Non-verifiable tasks"
label var rec_perceptionXnonver  "Recognition perception X Non-verifiable tasks"
label var skills_matchXnonver  "Skills match X Non-verifiable tasks"
label var non_ver_cat  "Non-verifiable tasks"



eststo clear
eststo: reg intrinsic_motivation resources non_ver_cat resourcesXnonver i.survey i.year i.dept_org, robust
eststo: reg intrinsic_motivation autonomy non_ver_cat autonomyXnonver i.survey i.year i.dept_org, robust
eststo: reg intrinsic_motivation creativity non_ver_cat creativityXnonver i.survey i.year i.dept_org, robust
eststo: reg intrinsic_motivation qual_supervisor non_ver_cat qual_supervisorXnonver i.survey i.year i.dept_org, robust
eststo: reg intrinsic_motivation rec_perception non_ver_cat rec_perceptionXnonver i.survey i.year i.dept_org, robust
eststo: reg intrinsic_motivation skills_match non_ver_cat skills_matchXnonver i.survey i.year i.dept_org, robust
esttab using table_A24.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year *.dept_org)


* Exclude FEVS *
preserve

drop if survey ==2

eststo clear
eststo: reg intrinsic_motivation resources non_ver_cat resourcesXnonver i.survey i.year i.dept_org, robust
eststo: reg intrinsic_motivation autonomy non_ver_cat autonomyXnonver i.survey i.year i.dept_org, robust
eststo: reg intrinsic_motivation creativity non_ver_cat creativityXnonver i.survey i.year i.dept_org, robust
eststo: reg intrinsic_motivation qual_supervisor non_ver_cat qual_supervisorXnonver i.survey i.year i.dept_org, robust
eststo: reg intrinsic_motivation rec_perception non_ver_cat rec_perceptionXnonver i.survey i.year i.dept_org, robust
eststo: reg intrinsic_motivation skills_match non_ver_cat skills_matchXnonver i.survey i.year i.dept_org, robust
esttab using table_A26.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year *.dept_org)


restore

/*****Regression Table for intrinsic motivation with non-verifiable interaction terms H4 (P2) *****/ 
* DV: Intrinsic motivation *
* IV: management practice, non-verifiable, management practice X non-verifiable  *
* survey FEs *

eststo clear
eststo: reg intrinsic_motivation resources non_ver_cat resourcesXnonver i.survey, robust
eststo: reg intrinsic_motivation autonomy non_ver_cat autonomyXnonver i.survey, robust
eststo: reg intrinsic_motivation creativity non_ver_cat creativityXnonver i.survey, robust
eststo: reg intrinsic_motivation qual_supervisor non_ver_cat qual_supervisorXnonver i.survey, robust
eststo: reg intrinsic_motivation rec_perception non_ver_cat rec_perceptionXnonver i.survey, robust
eststo: reg intrinsic_motivation skills_match non_ver_cat skills_matchXnonver i.survey, robust
esttab using table_A25.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey)


* Exclude FEVS *

preserve

drop if survey ==2

eststo clear
eststo: reg intrinsic_motivation resources non_ver_cat resourcesXnonver i.survey, robust
eststo: reg intrinsic_motivation autonomy non_ver_cat autonomyXnonver i.survey, robust
eststo: reg intrinsic_motivation creativity non_ver_cat creativityXnonver i.survey, robust
eststo: reg intrinsic_motivation qual_supervisor non_ver_cat qual_supervisorXnonver i.survey, robust
eststo: reg intrinsic_motivation rec_perception non_ver_cat rec_perceptionXnonver i.survey, robust
eststo: reg intrinsic_motivation skills_match non_ver_cat skills_matchXnonver i.survey, robust
esttab using table_A27.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey)

restore




/*****Political/Government related models models (P1 & P2) *****/ 

//Encoding: 1: Canada 2:FEVS 3:India 4:UK

** Interaction terms **

gen autonomyXnew_govt = autonomy * new_govt
gen resourcesXnew_govt = resources * new_govt
gen devXnew_govt = dev * new_govt
gen clear_objXnew_govt = clear_obj * new_govt
gen coworkersXnew_govt = coworkers_perf * new_govt
gen creativityXnew_govt = creativity * new_govt
gen fair_rwdXnew_govt = fair_rwd * new_govt
gen mgr_fbXnew_govt = mgr_fb * new_govt

gen payXnew_govt = pay_satisfaction * new_govt
gen pysc_safetyXnew_govt = pysc_safety * new_govt
gen supervisorXnew_govt = qual_supervisor * new_govt
gen upr_mgmtXnew_govt = qual_upr_mgmt * new_govt
gen recXnew_govt = rec_perception * new_govt
gen skills_matchXnew_govt = skills_match * new_govt
gen well_beingXnew_govt = well_being * new_govt


** Labels **

label var autonomyXnew_govt "Autonomy X New government"
label var resourcesXnew_govt "Adequate resources X New government " 
label var devXnew_govt "Career & personal development X New government"
label var clear_objXnew_govt " Clear objective X New government"
label var coworkersXnew_govt "Coworkers' performance X New government"
label var creativityXnew_govt "Creativity & innovation X New government"
label var fair_rwdXnew_govt "Fair reward & punishment X New government"
label var mgr_fbXnew_govt "Managerial feedback X New government"

label var payXnew_govt "Pay satisfaction X New government"
label var pysc_safetyXnew_govt "Psychological safety New government"
label var supervisorXnew_govt "Quality supervisor X New government"
label var upr_mgmtXnew_govt  "Quality upper management X New government"
label var recXnew_govt "Recognition perception X New government"
label var skills_matchXnew_govt  "Skills match X New government" 
label var well_beingXnew_govt  "Well-being X New government"



* DV: Intrinsic motivation *
* IV: management practice, new_govt, management practice X new_govt  *
* agency, year and survey FEs *

** Part I **
eststo clear
eststo: reg intrinsic_motivation autonomy new_govt autonomyXnew_govt  i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation resources new_govt resourcesXnew_govt  i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation dev new_govt devXnew_govt  i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation clear_obj new_govt clear_objXnew_govt  i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation coworkers_perf new_govt coworkersXnew_govt  i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation creativity new_govt creativityXnew_govt i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation fair_rwd new_govt fair_rwdXnew_govt  i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation mgr_fb new_govt mgr_fbXnew_govt i.survey i.year i.dept_org, robust  
esttab using table_A28.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year *.dept_org)

** Part II **
eststo clear
eststo: reg intrinsic_motivation pay_satisfaction new_govt payXnew_govt  i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation pysc_safety new_govt pysc_safetyXnew_govt  i.survey i.year i.dept_org, robust   
eststo: reg intrinsic_motivation qual_supervisor new_govt supervisorXnew_govt  i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation qual_upr_mgmt new_govt upr_mgmtXnew_govt  i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation rec_perception new_govt recXnew_govt  i.survey i.year i.dept_org, robust   
eststo: reg intrinsic_motivation skills_match new_govt skills_matchXnew_govt  i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation well_being new_govt well_beingXnew_govt  i.survey i.year i.dept_org, robust 
esttab using table_A29.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year *.dept_org)




* DV: Intrinsic motivation *
* IV: management practice, new_govt, management practice X new_govt  *
* agency, year and survey FEs *

**Part I table **
eststo clear
eststo: reg intrinsic_motivation autonomy new_govt autonomyXnew_govt  i.survey , robust 
eststo: reg intrinsic_motivation resources new_govt resourcesXnew_govt  i.survey , robust 
eststo: reg intrinsic_motivation dev new_govt devXnew_govt  i.survey , robust 
eststo: reg intrinsic_motivation clear_obj new_govt clear_objXnew_govt  i.survey , robust 
eststo: reg intrinsic_motivation coworkers_perf new_govt coworkersXnew_govt  i.survey , robust 
eststo: reg intrinsic_motivation creativity new_govt creativityXnew_govt i.survey , robust 
eststo: reg intrinsic_motivation fair_rwd new_govt fair_rwdXnew_govt  i.survey , robust 
eststo: reg intrinsic_motivation mgr_fb new_govt mgr_fbXnew_govt i.survey , robust  
esttab using table_A30.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey)

**Part II table **
eststo clear
eststo: reg intrinsic_motivation pay_satisfaction new_govt payXnew_govt  i.survey , robust 
eststo: reg intrinsic_motivation pysc_safety new_govt pysc_safetyXnew_govt  i.survey , robust   
eststo: reg intrinsic_motivation qual_supervisor new_govt supervisorXnew_govt  i.survey , robust 
eststo: reg intrinsic_motivation qual_upr_mgmt new_govt upr_mgmtXnew_govt  i.survey , robust 
eststo: reg intrinsic_motivation rec_perception new_govt recXnew_govt  i.survey , robust   
eststo: reg intrinsic_motivation skills_match new_govt skills_matchXnew_govt  i.survey , robust 
eststo: reg intrinsic_motivation well_being new_govt well_beingXnew_govt  i.survey , robust 
esttab using table_A31.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey)



** The effect on new_govt on intrinsic motivation **

eststo clear
eststo: reg intrinsic_motivation new_govt i.survey i.year i.dept_org, robust 
eststo: reg intrinsic_motivation  new_govt i.survey , robust 
esttab using table_A34.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year *.dept_org)




/*** Other Employee Attitudes: Employee Inclusion, Job Satisfaction, Organizational Pride, WPI ***/

/** P1 models, with survey, year, and agency FEs **/

** Employee inclusion **
eststo clear
eststo: reg employee_inclusion autonomy i.survey i.year i.dept_org, robust   //Canada and UK only
eststo: reg employee_inclusion resources i.survey i.year i.dept_org, robust  
eststo: reg employee_inclusion dev i.survey i.year i.dept_org, robust
eststo: reg employee_inclusion clear_obj i.survey i.year i.dept_org, robust
eststo: reg employee_inclusion creativity i.survey i.year i.dept_org, robust
eststo: reg employee_inclusion fair_rwd i.survey i.year i.dept_org, robust //UK only
eststo: reg employee_inclusion mgr_fb i.survey i.year i.dept_org, robust  //UK only
esttab using table_A36.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year *.dept_org)


eststo clear
eststo: reg employee_inclusion pay_satisfaction i.survey i.year i.dept_org, robust 
eststo: reg employee_inclusion pysc_safety i.survey i.year i.dept_org, robust      // UK only
eststo: reg employee_inclusion qual_supervisor i.survey i.year i.dept_org, robust 
eststo: reg employee_inclusion qual_upr_mgmt i.survey i.year i.dept_org, robust 
eststo: reg employee_inclusion rec_perception i.survey i.year i.dept_org, robust 
eststo: reg employee_inclusion skills_match i.survey i.year i.dept_org, robust 
eststo: reg employee_inclusion well_being i.survey i.year i.dept_org, robust 
esttab using table_A37.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year *.dept_org)



** Job Satisfaction **
eststo clear
eststo: reg job_satisfaction autonomy i.survey i.year i.dept_org, robust 
eststo: reg job_satisfaction resources i.survey i.year i.dept_org, robust  
eststo: reg job_satisfaction dev i.survey i.year i.dept_org, robust
eststo: reg job_satisfaction clear_obj i.survey i.year i.dept_org, robust
eststo: reg job_satisfaction creativity i.survey i.year i.dept_org, robust
eststo: reg job_satisfaction fair_rwd i.survey i.year i.dept_org, robust 
eststo: reg job_satisfaction mgr_fb i.survey i.year i.dept_org, robust
esttab using table_A38.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year *.dept_org)


eststo clear
eststo: reg job_satisfaction pay_satisfaction i.survey i.year i.dept_org, robust 
eststo: reg job_satisfaction pysc_safety i.survey i.year i.dept_org, robust 
eststo: reg job_satisfaction qual_supervisor i.survey i.year i.dept_org, robust 
eststo: reg job_satisfaction qual_upr_mgmt i.survey i.year i.dept_org, robust 
eststo: reg job_satisfaction rec_perception i.survey i.year i.dept_org, robust 
eststo: reg job_satisfaction skills_match i.survey i.year i.dept_org, robust 
eststo: reg job_satisfaction well_being i.survey i.year i.dept_org, robust 
esttab using table_A39.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year *.dept_org)



** Organizational Pride **
eststo clear
eststo: reg org_pride autonomy i.survey i.year i.dept_org, robust 
eststo: reg org_pride resources i.survey i.year i.dept_org, robust  
eststo: reg org_pride dev i.survey i.year i.dept_org, robust
eststo: reg org_pride clear_obj i.survey i.year i.dept_org, robust
eststo: reg org_pride creativity i.survey i.year i.dept_org, robust
eststo: reg org_pride fair_rwd i.survey i.year i.dept_org, robust 
eststo: reg org_pride mgr_fb i.survey i.year i.dept_org, robust
esttab using table_A40.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year *.dept_org)


eststo clear
eststo: reg org_pride pay_satisfaction i.survey i.year i.dept_org, robust 
eststo: reg org_pride pysc_safety i.survey i.year i.dept_org, robust 
eststo: reg org_pride qual_supervisor i.survey i.year i.dept_org, robust 
eststo: reg org_pride qual_upr_mgmt i.survey i.year i.dept_org, robust 
eststo: reg org_pride rec_perception i.survey i.year i.dept_org, robust 
eststo: reg org_pride skills_match i.survey i.year i.dept_org, robust 
eststo: reg org_pride well_being i.survey i.year i.dept_org, robust 
esttab using table_A41.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year *.dept_org)



** WPI-Enjoyment **
eststo clear
eststo: reg wpi_e autonomy i.survey i.year i.dept_org, robust 
eststo: reg wpi_e resources i.survey i.year i.dept_org, robust  
eststo: reg wpi_e dev i.survey i.year i.dept_org, robust
eststo: reg wpi_e clear_obj i.survey i.year i.dept_org, robust
eststo: reg wpi_e creativity i.survey i.year i.dept_org, robust
eststo: reg wpi_e fair_rwd i.survey i.year i.dept_org, robust 
eststo: reg wpi_e mgr_fb i.survey i.year i.dept_org, robust
esttab using table_A42.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year *.dept_org)


eststo clear
eststo: reg wpi_e pay_satisfaction i.survey i.year i.dept_org, robust 
eststo: reg wpi_e pysc_safety i.survey i.year i.dept_org, robust 
eststo: reg wpi_e qual_supervisor i.survey i.year i.dept_org, robust 
eststo: reg wpi_e qual_upr_mgmt i.survey i.year i.dept_org, robust 
eststo: reg wpi_e rec_perception i.survey i.year i.dept_org, robust 
eststo: reg wpi_e skills_match i.survey i.year i.dept_org, robust 
eststo: reg wpi_e well_being i.survey i.year i.dept_org, robust 
esttab using table_A43.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year *.dept_org)



/** P2 models, with survey FEs **/


** Employee inclusion **

eststo clear
eststo: reg employee_inclusion autonomy i.survey , robust   //Canada and UK only
eststo: reg employee_inclusion resources i.survey , robust  
eststo: reg employee_inclusion dev i.survey , robust
eststo: reg employee_inclusion clear_obj i.survey , robust
eststo: reg employee_inclusion creativity i.survey , robust
eststo: reg employee_inclusion fair_rwd i.survey , robust //UK only
eststo: reg employee_inclusion mgr_fb i.survey , robust  //UK only
esttab using table_A44.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey) 


eststo clear
eststo: reg employee_inclusion pay_satisfaction i.survey , robust 
eststo: reg employee_inclusion pysc_safety i.survey , robust      // UK only
eststo: reg employee_inclusion qual_supervisor i.survey , robust 
eststo: reg employee_inclusion qual_upr_mgmt i.survey , robust 
eststo: reg employee_inclusion rec_perception i.survey , robust 
eststo: reg employee_inclusion skills_match i.survey , robust 
eststo: reg employee_inclusion well_being i.survey , robust 
esttab using table_A45.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey)



** Job Satisfaction **

eststo clear
eststo: reg job_satisfaction autonomy i.survey , robust 
eststo: reg job_satisfaction resources i.survey , robust  
eststo: reg job_satisfaction dev i.survey , robust
eststo: reg job_satisfaction clear_obj i.survey , robust
eststo: reg job_satisfaction creativity i.survey , robust
eststo: reg job_satisfaction fair_rwd i.survey , robust 
eststo: reg job_satisfaction mgr_fb i.survey , robust
esttab using table_A46.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey)


eststo clear
eststo: reg job_satisfaction pay_satisfaction i.survey , robust 
eststo: reg job_satisfaction pysc_safety i.survey , robust 
eststo: reg job_satisfaction qual_supervisor i.survey , robust 
eststo: reg job_satisfaction qual_upr_mgmt i.survey , robust 
eststo: reg job_satisfaction rec_perception i.survey , robust 
eststo: reg job_satisfaction skills_match i.survey , robust 
eststo: reg job_satisfaction well_being i.survey , robust 
esttab using table_A47.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey)




** Organizational Pride **

eststo clear
eststo: reg org_pride autonomy i.survey , robust 
eststo: reg org_pride resources i.survey , robust  
eststo: reg org_pride dev i.survey , robust
eststo: reg org_pride clear_obj i.survey , robust
eststo: reg org_pride creativity i.survey , robust
eststo: reg org_pride fair_rwd i.survey , robust 
eststo: reg org_pride mgr_fb i.survey , robust
esttab using table_A48.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey)


eststo clear
eststo: reg org_pride pay_satisfaction i.survey , robust 
eststo: reg org_pride pysc_safety i.survey , robust 
eststo: reg org_pride qual_supervisor i.survey , robust 
eststo: reg org_pride qual_upr_mgmt i.survey , robust 
eststo: reg org_pride rec_perception i.survey , robust 
eststo: reg org_pride skills_match i.survey , robust 
eststo: reg org_pride well_being i.survey , robust 
esttab using table_A49.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey)




** WPI-Enjoyment **

eststo clear
eststo: reg wpi_e autonomy i.survey , robust 
eststo: reg wpi_e resources i.survey , robust  
eststo: reg wpi_e dev i.survey , robust
eststo: reg wpi_e clear_obj i.survey , robust
eststo: reg wpi_e creativity i.survey , robust
eststo: reg wpi_e fair_rwd i.survey , robust 
eststo: reg wpi_e mgr_fb i.survey , robust
esttab using table_A50.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey )


eststo clear
eststo: reg wpi_e pay_satisfaction i.survey , robust 
eststo: reg wpi_e pysc_safety i.survey , robust 
eststo: reg wpi_e qual_supervisor i.survey , robust 
eststo: reg wpi_e qual_upr_mgmt i.survey , robust 
eststo: reg wpi_e rec_perception i.survey , robust 
eststo: reg wpi_e skills_match i.survey , robust 
eststo: reg wpi_e well_being i.survey , robust 
esttab using table_A51.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey)


 
 ##################################################################################################################################
 
 
 
 
**** #### Models with Individual Level Data ###


clear

*global STATA_directory "INSERT ROOT DIRECTORY PATHWAY HERE" 
cd "$STATA_directory"

cd "$STATA_directory" 
import delimited "data_p3",clear 
set matsize 800




/**************** Process Data **********************/

//store all IVs and DVs in a local list
local myvars wpi_c wpi_e wpi_o autonomy clear_obj corruption coworkers_perf ///
creativity dev employee_inclusion fair_rwd intend_to_leave intrinsic_motivation  ///
job satisfaction making_a_diff mgr_fb org_pride pay_satisfaction promote_ethics pysc_safety ///
qual_supervisor qual_upr_mgmt rec_perception resources safety  ///
skills_match well_being year survey 


//replace all "NA" to ".", STATA does not recognize NA as missing value 
foreach v in `myvars' {
	capture confirm string variable `v'  // Do only for all string variable (columns with NA)
	if !_rc {
		replace `v' = "" if `v' == "NA"
	}
 }

//Encode "survey" as a numeric variable:
encode survey, gen(survey1)
drop survey
rename survey1 survey
order survey

//Encode "govt" as a numeric variable:
encode govt, gen(govt1)
drop govt
rename govt1 govt
order govt



/** Label Variables **/

label var intrinsic_motivation "Intrinsic Motivation"
label var autonomy  "Autonomy"
label var resources  "Adequate resources"
label var dev  "Career & personal development"
label var clear_obj  "Clear objective"
label var creativity  "Creativity & innovation"
label var promote_ethics  "Ethics promotion"
label var fair_rwd  "Fair reward & punishment"
label var mgr_fb  "Managerial feedback"

label var pay_satisfaction  "Pay satisfaction"
label var qual_supervisor  "Quality supervisor"
label var qual_upr_mgmt  "Quality upper management"
label var rec_perception  "Recognition perception"
label var skills_match  "Skills match"
label var well_being  "Well-being"
label var safety  "Workplace safety"
label var govt  "Government"

label var job_satisfaction  "job satisfaction"
label var org_pride  "Organizational Pride"
label var wpi_c  "WPI-Challenge"
label var wpi_o  "WPI-Outward Recognition"
label var intend_to_leave  "Intent to leave"


**Shift Directory so Tables Save in Subfolder
cd "$STATA_directory/table_output" 

/** Summary Table **/

sutex2 intrinsic_motivation autonomy resources dev clear_obj creativity promote_ethics fair_rwd ///
mgr_fb pay_satisfaction qual_supervisor qual_upr_mgmt rec_perception ///
skills_match well_being safety coworkers_perf intend_to_leave, min varlabels saving (full_individual_data_summary_MAINPAPER_Table_4.tex) replace  // full

** APS only **
preserve
keep if survey == 1 

sutex2 intrinsic_motivation autonomy resources dev clear_obj creativity promote_ethics fair_rwd ///
mgr_fb pay_satisfaction qual_supervisor qual_upr_mgmt rec_perception ///
skills_match well_being safety coworkers_perf intend_to_leave, min varlabels saving (APS_summary_p3_Table_A4.tex) replace  

restore

** FEVS only **

preserve
keep if survey == 3 

sutex2 intrinsic_motivation autonomy resources dev clear_obj creativity promote_ethics fair_rwd ///
mgr_fb pay_satisfaction qual_supervisor qual_upr_mgmt rec_perception ///
skills_match well_being safety coworkers_perf intend_to_leave, min varlabels saving (FEVS_summary_p3_Table_A2.tex) replace  

restore

** EPS only **

preserve
keep if survey == 2 

sutex2 intrinsic_motivation autonomy resources dev clear_obj creativity promote_ethics fair_rwd ///
mgr_fb pay_satisfaction qual_supervisor qual_upr_mgmt rec_perception ///
skills_match well_being safety coworkers_perf intend_to_leave, min varlabels saving (EPS_summary_Table_A3.tex) replace  

restore




/** Regression table of Intrinsic Motivation on Management Practices **/

eststo clear
eststo: reg intrinsic_motivation autonomy i.survey i.year, robust 
eststo: reg intrinsic_motivation resources i.survey i.year, robust  
eststo: reg intrinsic_motivation dev i.survey i.year, robust
eststo: reg intrinsic_motivation clear_obj i.survey i.year, robust
eststo: reg intrinsic_motivation creativity i.survey i.year, robust
eststo: reg intrinsic_motivation promote_ethics i.survey i.year, robust
eststo: reg intrinsic_motivation fair_rwd i.survey i.year, robust 
eststo: reg intrinsic_motivation mgr_fb i.survey i.year, robust
esttab using table_A8.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)


eststo clear
eststo: reg intrinsic_motivation pay_satisfaction i.survey i.year, robust
eststo: reg intrinsic_motivation qual_supervisor i.survey i.year, robust
eststo: reg intrinsic_motivation qual_upr_mgmt i.survey i.year, robust
eststo: reg intrinsic_motivation rec_perception i.survey i.year, robust  
eststo: reg intrinsic_motivation skills_match i.survey i.year, robust
eststo: reg intrinsic_motivation well_being i.survey i.year, robust
eststo: reg intrinsic_motivation safety i.survey i.year, robust
esttab using table_A9.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)


**APS only**
preserve

keep if survey == 1 

eststo clear
eststo: reg intrinsic_motivation autonomy i.survey i.year, robust 
eststo: reg intrinsic_motivation resources i.survey i.year, robust  
eststo: reg intrinsic_motivation dev i.survey i.year, robust
eststo: reg intrinsic_motivation clear_obj i.survey i.year, robust
eststo: reg intrinsic_motivation creativity i.survey i.year, robust
eststo: reg intrinsic_motivation promote_ethics i.survey i.year, robust
eststo: reg intrinsic_motivation fair_rwd i.survey i.year, robust 
eststo: reg intrinsic_motivation mgr_fb i.survey i.year, robust
esttab using table_A10.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)

eststo clear
eststo: reg intrinsic_motivation pay_satisfaction i.survey i.year, robust
eststo: reg intrinsic_motivation qual_supervisor i.survey i.year, robust
eststo: reg intrinsic_motivation qual_upr_mgmt i.survey i.year, robust
//eststo: reg intrinsic_motivation rec_perception i.survey i.year, robust  
eststo: reg intrinsic_motivation skills_match i.survey i.year, robust
eststo: reg intrinsic_motivation well_being i.survey i.year, robust
eststo: reg intrinsic_motivation safety i.survey i.year, robust
esttab using table_A11.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)


restore



***** Intent to leave models ******

* Regression Intent_to_leave on intrinsic motivation, management practice and interaction 
* of intrinsic motivation and management practice

** Generate interaction terms **
gen autonomyXintrinsic_motivation = autonomy * intrinsic_motivation
gen resourcesXintrinsic_motivation = resources * intrinsic_motivation
gen devXintrinsic_motivation = dev * intrinsic_motivation
gen coworkersXintrinsic_motivation = coworkers_perf * intrinsic_motivation
gen clear_objXintrinsic_motivation = clear_obj * intrinsic_motivation
gen creativityXintrinsic_motivation = creativity * intrinsic_motivation
gen promoteXintrinsic_motivation = promote_ethics * intrinsic_motivation
gen fair_rwdXintrinsic_motivation = fair_rwd * intrinsic_motivation

gen mgr_fbXintrinsic_motivation = mgr_fb * intrinsic_motivation
gen payXintrinsic_motivation = pay_satisfaction * intrinsic_motivation
gen supervisorXintrinsic_motivation = qual_supervisor * intrinsic_motivation
gen upr_mgmtXintrinsic_motivation = qual_upr_mgmt * intrinsic_motivation
gen recXintrinsic_motivation = rec_perception * intrinsic_motivation
gen skillsXintrinsic_motivation = skills_match * intrinsic_motivation
gen well_beingXintrinsic_motivation = well_being * intrinsic_motivation
gen safetyXintrinsic_motivation = safety * intrinsic_motivation

** Labels **
label var autonomyXintrinsic_motivation  "Autonomy X Intrinsic motivation"
label var resourcesXintrinsic_motivation  "Adequate resources X "
label var devXintrinsic_motivation  "Career & personal development X Intrinsic motivation"
label var coworkersXintrinsic_motivation "Co-workers' performance X Intrinsic motivation"
label var clear_objXintrinsic_motivation  "Clear objective X Intrinsic motivation"
label var creativityXintrinsic_motivation  "Creativity & innovation X Intrinsic motivation"
label var promoteXintrinsic_motivation  "Ethics promotion X Intrinsic motivation"
label var fair_rwdXintrinsic_motivation  "Fair reward & punishment X Intrinsic motivation"

label var mgr_fbXintrinsic_motivation  "Managerial feedback X Intrinsic motivation"
label var payXintrinsic_motivation  "Pay satisfaction X Intrinsic motivation"
label var supervisorXintrinsic_motivation  "Quality supervisor X Intrinsic motivation"
label var upr_mgmtXintrinsic_motivation  "Quality upper management X Intrinsic motivation"
label var recXintrinsic_motivation  "Recognition perception X Intrinsic motivation"
label var skillsXintrinsic_motivation  "Skills match X Intrinsic motivation"
label var well_beingXintrinsic_motivation  "Well-being X Intrinsic motivation"
label var safetyXintrinsic_motivation  "Workplace safety X Intrinsic motivation"


** Regression Tables **

eststo clear
eststo: logit intend_to_leave autonomy intrinsic_motivation autonomyXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave resources intrinsic_motivation resourcesXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave dev intrinsic_motivation devXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave coworkers_perf intrinsic_motivation coworkersXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave clear_obj intrinsic_motivation clear_objXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave creativity intrinsic_motivation creativityXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave promote_ethics intrinsic_motivation promoteXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave fair_rwd intrinsic_motivation fair_rwdXintrinsic_motivation i.year i.survey, robust
esttab using table_A20.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)

eststo: logit intend_to_leave mgr_fb intrinsic_motivation mgr_fbXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave pay_satisfaction intrinsic_motivation payXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave qual_supervisor intrinsic_motivation supervisorXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave qual_upr_mgmt intrinsic_motivation upr_mgmtXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave rec_perception intrinsic_motivation recXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave skills_match intrinsic_motivation skillsXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave well_being intrinsic_motivation well_beingXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave safety intrinsic_motivation safetyXintrinsic_motivation i.year i.survey, robust
esttab using table_A21.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)



***** Only APS data *****
preserve
keep if survey == 1

eststo clear
eststo: logit intend_to_leave autonomy intrinsic_motivation autonomyXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave resources intrinsic_motivation resourcesXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave dev intrinsic_motivation devXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave coworkers_perf intrinsic_motivation coworkersXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave clear_obj intrinsic_motivation clear_objXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave creativity intrinsic_motivation creativityXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave promote_ethics intrinsic_motivation promoteXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave fair_rwd intrinsic_motivation fair_rwdXintrinsic_motivation i.year i.survey, robust
esttab using table_A22.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)


eststo clear
eststo: logit intend_to_leave mgr_fb intrinsic_motivation mgr_fbXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave pay_satisfaction intrinsic_motivation payXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave qual_supervisor intrinsic_motivation supervisorXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave qual_upr_mgmt intrinsic_motivation upr_mgmtXintrinsic_motivation i.year i.survey, robust
//eststo: logit intend_to_leave rec_perception intrinsic_motivation recXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave skills_match intrinsic_motivation skillsXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave well_being intrinsic_motivation well_beingXintrinsic_motivation i.year i.survey, robust
eststo: logit intend_to_leave safety intrinsic_motivation safetyXintrinsic_motivation i.year i.survey, robust
esttab using table_A23.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)



restore







**** Models that includes new_government (first two years of a new government) as independent variable  ****


** New Government interaction terms**
gen autonomyXnew_govt =  autonomy*new_govt
gen resourcesXnew_govt = resources*new_govt
gen devXnew_govt = dev*new_govt
gen clear_objXnew_govt = clear_obj*new_govt
gen creativityXnew_govt = creativity*new_govt
gen coworkersXnew_govt = coworkers_perf*new_govt
gen ethicsXnew_govt = promote_ethics*new_govt
gen fair_rwdXnew_govt = fair_rwd*new_govt
gen mgr_fbXnew_govt = mgr_fb*new_govt

gen payXnew_govt =  pay_satisfaction*new_govt
gen supervisorXnew_govt = qual_supervisor*new_govt
gen upr_mgmtXnew_govt = qual_upr_mgmt*new_govt
gen recXnew_govt = rec_perception*new_govt
gen skills_matchXnew_govt = skills_match*new_govt
gen well_beingXnew_govt = well_being*new_govt
gen safetyXnew_govt = safety*new_govt

**Labels **
label var autonomyXnew_govt  "Autonomy X New government"
label var resourcesXnew_govt  "Adequate resources X New government"
label var devXnew_govt  "Career & personal development X New government"
label var creativityXnew_govt  "Clear objective X New government"
label var creativity  "Creativity & innovation X New government"
label var coworkersXnew_govt "Coworkers' performance X New government"
label var ethicsXnew_govt  "Ethics promotion X New government"
label var fair_rwdXnew_govt  "Fair reward & punishment X New government"
label var mgr_fbXnew_govt  "Managerial feedback X New government"

label var payXnew_govt  "Pay satisfaction X New government"
label var supervisorXnew_govt  "Quality supervisor X New government"
label var upr_mgmtXnew_govt  "Quality upper management X New government"
label var recXnew_govt  "Recognition perception X New government"
label var skills_matchXnew_govt  "Skills match X New government"
label var well_beingXnew_govt  "Well-being X New government"
label var safetyXnew_govt  "Workplace safety X New government"
label var new_govt  "New government"


** DV: Intrinsic motivation 
** IV: new government, management practice, interaction of new government and management practice
eststo clear
eststo: reg intrinsic_motivation autonomy new_govt autonomyXnew_govt i.survey i.year, robust 
eststo: reg intrinsic_motivation resources new_govt resourcesXnew_govt i.survey i.year, robust  
eststo: reg intrinsic_motivation dev new_govt devXnew_govt  i.survey i.year, robust
eststo: reg intrinsic_motivation clear_obj new_govt clear_objXnew_govt i.survey i.year, robust
eststo: reg intrinsic_motivation creativity new_govt i.survey creativityXnew_govt i.year, robust
eststo: reg intrinsic_motivation coworkers_perf new_govt coworkersXnew_govt i.survey i.year, robust
eststo: reg intrinsic_motivation promote_ethics new_govt ethicsXnew_govt i.survey i.year, robust
eststo: reg intrinsic_motivation fair_rwd new_govt fair_rwdXnew_govt i.survey i.year, robust 
eststo: reg intrinsic_motivation mgr_fb new_govt mgr_fbXnew_govt i.survey i.year, robust
esttab using table_A32.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)

eststo clear
eststo: reg intrinsic_motivation pay_satisfaction new_govt payXnew_govt i.survey i.year, robust
eststo: reg intrinsic_motivation qual_supervisor new_govt supervisorXnew_govt i.survey i.year, robust
eststo: reg intrinsic_motivation qual_upr_mgmt new_govt upr_mgmtXnew_govt i.survey i.year, robust
eststo: reg intrinsic_motivation rec_perception new_govt recXnew_govt i.survey i.year, robust  
eststo: reg intrinsic_motivation skills_match new_govt skills_matchXnew_govt i.survey i.year, robust
eststo: reg intrinsic_motivation well_being new_govt well_beingXnew_govt i.survey i.year, robust
eststo: reg intrinsic_motivation safety new_govt safetyXnew_govt i.survey i.year, robust
esttab using table_A33.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)



** DV: intent to leave 
** IV: new government, management practice, interaction of new government and management practice
eststo clear
eststo: logit intend_to_leave autonomy new_govt autonomyXnew_govt i.survey i.year, robust 
eststo: logit intend_to_leave resources new_govt resourcesXnew_govt i.survey i.year, robust  
eststo: logit intend_to_leave dev new_govt devXnew_govt  i.survey i.year, robust
eststo: logit intend_to_leave clear_obj new_govt clear_objXnew_govt i.survey i.year, robust
eststo: logit intend_to_leave creativity new_govt i.survey creativityXnew_govt i.year, robust
eststo: logit intend_to_leave coworkers_perf new_govt coworkersXnew_govt i.survey i.year, robust
eststo: logit intend_to_leave promote_ethics new_govt ethicsXnew_govt i.survey i.year, robust
eststo: logit intend_to_leave fair_rwd new_govt fair_rwdXnew_govt i.survey i.year, robust 
eststo: logit intend_to_leave mgr_fb new_govt mgr_fbXnew_govt i.survey i.year, robust
esttab using table_A35.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)

eststo clear
eststo: logit intend_to_leave pay_satisfaction new_govt payXnew_govt i.survey i.year, robust
eststo: logit intend_to_leave qual_supervisor new_govt supervisorXnew_govt i.survey i.year, robust
eststo: logit intend_to_leave qual_upr_mgmt new_govt upr_mgmtXnew_govt i.survey i.year, robust
eststo: logit intend_to_leave rec_perception new_govt recXnew_govt i.survey i.year, robust  
eststo: logit intend_to_leave skills_match new_govt skills_matchXnew_govt i.survey i.year, robust
eststo: logit intend_to_leave well_being new_govt well_beingXnew_govt i.survey i.year, robust
eststo: logit intend_to_leave safety new_govt safetyXnew_govt i.survey i.year, robust
esttab using table_A36.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)


** The effects of new government on employee attitudes (intrinsic motivation and intent to leave) **

eststo clear
eststo: reg intrinsic_motivation new_govt i.survey i.year, robust 
eststo: logit intend_to_leave new_govt i.survey i.year, robust 
esttab using table_A37.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)




/** Regression Tables of Employee Attitudes (Job Satisfaction, Organizational 
      Pride, WPI, Intent to leave) on Management Practice 
**/ 


** Job Satisfaction **

eststo clear
eststo: reg job_satisfaction autonomy i.survey i.year, robust 
eststo: reg job_satisfaction resources i.survey i.year, robust  
eststo: reg job_satisfaction dev i.survey i.year, robust
eststo: reg job_satisfaction clear_obj i.survey i.year, robust
eststo: reg job_satisfaction creativity i.survey i.year, robust
eststo: reg job_satisfaction promote_ethics i.survey i.year, robust
eststo: reg job_satisfaction fair_rwd i.survey i.year, robust 
eststo: reg job_satisfaction mgr_fb i.survey i.year, robust
esttab using table_A52.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)


eststo clear
eststo: reg job_satisfaction pay_satisfaction i.survey i.year, robust
eststo: reg job_satisfaction qual_supervisor i.survey i.year, robust
eststo: reg job_satisfaction qual_upr_mgmt i.survey i.year, robust
eststo: reg job_satisfaction rec_perception i.survey i.year, robust  
eststo: reg job_satisfaction skills_match i.survey i.year, robust
eststo: reg job_satisfaction well_being i.survey i.year, robust
eststo: reg job_satisfaction safety i.survey i.year, robust
esttab using table_A53.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)


** Organizational Pride **


eststo clear
eststo: reg org_pride autonomy i.survey i.year, robust 
eststo: reg org_pride resources i.survey i.year, robust  
eststo: reg org_pride dev i.survey i.year, robust
eststo: reg org_pride clear_obj i.survey i.year, robust
eststo: reg org_pride creativity i.survey i.year, robust
eststo: reg org_pride promote_ethics i.survey i.year, robust
eststo: reg org_pride fair_rwd i.survey i.year, robust 
eststo: reg org_pride mgr_fb i.survey i.year, robust
esttab using table_A54.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)


eststo clear
eststo: reg org_pride pay_satisfaction i.survey i.year, robust
eststo: reg org_pride qual_supervisor i.survey i.year, robust
eststo: reg org_pride qual_upr_mgmt i.survey i.year, robust
eststo: reg org_pride rec_perception i.survey i.year, robust  
eststo: reg org_pride skills_match i.survey i.year, robust
eststo: reg org_pride well_being i.survey i.year, robust
eststo: reg org_pride safety i.survey i.year, robust
esttab using table_A55.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)


** WPI-Challenge **


eststo clear
eststo: reg wpi_c autonomy i.survey i.year, robust 
eststo: reg wpi_c resources i.survey i.year, robust  
eststo: reg wpi_c dev i.survey i.year, robust
eststo: reg wpi_c clear_obj i.survey i.year, robust
eststo: reg wpi_c creativity i.survey i.year, robust
eststo: reg wpi_c promote_ethics i.survey i.year, robust
eststo: reg wpi_c fair_rwd i.survey i.year, robust 
eststo: reg wpi_c mgr_fb i.survey i.year, robust
esttab using table_A56.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)


eststo clear
eststo: reg wpi_c pay_satisfaction i.survey i.year, robust
eststo: reg wpi_c qual_supervisor i.survey i.year, robust
eststo: reg wpi_c qual_upr_mgmt i.survey i.year, robust
eststo: reg wpi_c rec_perception i.survey i.year, robust  
eststo: reg wpi_c skills_match i.survey i.year, robust
eststo: reg wpi_c well_being i.survey i.year, robust
eststo: reg wpi_c safety i.survey i.year, robust
esttab using table_A57.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)


** WPI- Outward Recognition **

eststo clear
eststo: reg wpi_o autonomy i.survey i.year, robust 
eststo: reg wpi_o resources i.survey i.year, robust  
eststo: reg wpi_o dev i.survey i.year, robust
eststo: reg wpi_o clear_obj i.survey i.year, robust
eststo: reg wpi_o creativity i.survey i.year, robust
eststo: reg wpi_o promote_ethics i.survey i.year, robust
eststo: reg wpi_o fair_rwd i.survey i.year, robust 
eststo: reg wpi_o mgr_fb i.survey i.year, robust
esttab using table_A58.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)


eststo clear
eststo: reg wpi_o pay_satisfaction i.survey i.year, robust
eststo: reg wpi_o qual_supervisor i.survey i.year, robust
eststo: reg wpi_o qual_upr_mgmt i.survey i.year, robust
eststo: reg wpi_o rec_perception i.survey i.year, robust  
eststo: reg wpi_o skills_match i.survey i.year, robust
eststo: reg wpi_o well_being i.survey i.year, robust
eststo: reg wpi_o safety i.survey i.year, robust
esttab using table_A59.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)


** Intent to leave **


eststo clear
eststo: logit intend_to_leave autonomy i.survey i.year, robust 
eststo: logit intend_to_leave resources i.survey i.year, robust  
eststo: logit intend_to_leave dev i.survey i.year, robust
eststo: logit intend_to_leave clear_obj i.survey i.year, robust
eststo: logit intend_to_leave creativity i.survey i.year, robust
eststo: logit intend_to_leave promote_ethics i.survey i.year, robust
eststo: logit intend_to_leave fair_rwd i.survey i.year, robust 
eststo: logit intend_to_leave mgr_fb i.survey i.year, robust
esttab using table_A60.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)


eststo clear
eststo: logit intend_to_leave pay_satisfaction i.survey i.year, robust
eststo: logit intend_to_leave qual_supervisor i.survey i.year, robust
eststo: logit intend_to_leave qual_upr_mgmt i.survey i.year, robust
eststo: logit intend_to_leave rec_perception i.survey i.year, robust  
eststo: logit intend_to_leave skills_match i.survey i.year, robust
eststo: logit intend_to_leave well_being i.survey i.year, robust
eststo: logit intend_to_leave safety i.survey i.year, robust
esttab using table_A61.tex, se label star(* 0.10 ** 0.05 *** 0.01) r2 obslast replace booktabs drop (*.survey *.year)
